STEP 8: We must use the variable value as the image label when we create sprites so that we see different pets!

  • In the .Sprite() command, change the string "codesters" to the variable value (no quotes!).
  • Change the xy-coordinates in the .Sprite() command to -200, -150.

Click Run and notice that three different sprites are created! Each time the loop runs, value is storing the next string stored in pet_list.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)